package gdut.imis.controller;

import gdut.imis.Utils.Result;
import gdut.imis.domain.ClubInstitutionDepartmentStudentRel;
import gdut.imis.service.ClubInstitutionDepartmentStudentRelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author JiaFu
 * @Date 2023/4/7 15:08
 */
@RestController
@RequestMapping("/club-institution-department-student-rel")
@Api(value = "社团机构部门与学生关联接口", tags = {"社团机构部门与学生关联接口"})
@RequiredArgsConstructor
public class ClubInstitutionDepartmentStudentRelController extends BaseController {
    private final ClubInstitutionDepartmentStudentRelService clubInstitutionDepartmentStudentRelService;

    @ApiOperation("新增社团机构部门与学生关联档案")
    @PostMapping("/addDepartmentStuRel")
    @PreAuthorize("@cp.hasPermission('clubInstitutionDepartmentStudentRel')")
    public Result addDepartmentStuRel(@RequestBody ClubInstitutionDepartmentStudentRel clubInstitutionDepartmentStudentRel) {
        return clubInstitutionDepartmentStudentRelService.addDepartmentStuRel(clubInstitutionDepartmentStudentRel);
    }

}
